Imports System.Data.SqlClient
Imports Microsoft.ApplicationBlocks.Data.SqlHelper

Public Class OrdenesdeCompra

    Public Function Generar(ByVal Fecha As Date, ByVal Observaciones As String)
        Dim CodigoOC As Integer
        CodigoOC = ExecuteScalar(My.Settings.MiCadena, CommandType.StoredProcedure, "OrdenesDeCompraGenerar", New SqlParameter("@Fecha", Fecha), New SqlParameter("@Observaciones", Observaciones))
        Return CodigoOC
    End Function

    Public Function ObtenerPendientes()
        Dim DS As New DataSet
        DS = ExecuteDataset(My.Settings.MiCadena, CommandType.StoredProcedure, "OrdenesDeCompraPendientesObtener")
        Return DS
    End Function

    Public Sub Eliminar(ByVal Cod_OC As Integer)
        ExecuteNonQuery(My.Settings.MiCadena, CommandType.StoredProcedure, "OrdenDeCompraEliminar", New SqlParameter("@Cod_OC", Cod_OC))
    End Sub

End Class
